﻿///////////////////////////////////////////////////////////////////////////
//内容顶客扩展插件
///////////////////////////////////////////////////////////////////////////
function ajaxPluginDigg(cType,id)
{
	if(PluginDigg==null)
	{
		$("#ajaxPluginDigg").hide();
		return;
	}
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"oper=ajaxPluginDigg&id="+id+"&cType="+cType+"&time="+(new Date().getTime()),
		url:		site.Dir + "extends/digg/ajax.aspx",
		error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
		success:	function(d){
			$("#ajaxPluginDigg").setTemplateURL(site.Dir + "extends/digg/templates/_digg.htm?time="+(new Date().getTime()), null, {filter_data: true});
			$("#ajaxPluginDigg").processTemplate(d);
		}
	});
}
function ajaxPluginDiggCount(cType,id)
{
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"oper=ajaxPluginDiggCount&id="+id+"&cType="+cType+"&time="+(new Date().getTime()),
		url:		site.Dir + "extends/digg/ajax.aspx",
		error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
		success:	function(d){
			$("#ajaxPluginDigg_"+id).text(d.count);
		}
	});
}
function ajaxPluginDiggAdd(cType,id)
{
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"oper=ajaxPluginDiggAdd&id="+id+"&cType="+cType+"&time="+(new Date().getTime()),
		url:		site.Dir + "extends/digg/ajax.aspx",
		error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
		success:	function(d){
			$("#ajaxPluginDigg_"+id).text(d.count);
			$("#DiggSpan"+id).html("<a>顶过了</a>");

		}
	});
}